﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace RCSoft.Core
{
    /// <summary>
    /// 应用程序抛出异常
    /// </summary>
    [Serializable]
    public class RCSoftException : Exception
    {
        /// <summary>
        /// 初始化异常
        /// </summary>
        public RCSoftException() { }

        /// <summary>
        /// 初始化抛出指定异常消息
        /// </summary>
        /// <param name="message"></param>
        public RCSoftException(string message)
            : base(message)
        { }

        /// <summary>
        /// 参数化抛出指定异常消息
        /// </summary>
        /// <param name="messageFormat">异常消息格式</param>
        /// <param name="args">异常消息参数</param>
        public RCSoftException(string messageFormat, params object[] args)
            : base(string.Format(messageFormat, args))
        { }

        /// <summary>
        /// 序列号抛出异常消息
        /// </summary>
        /// <param name="info">序列化异常消息</param>
        /// <param name="context">异常内容</param>
        protected RCSoftException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }

        /// <summary>
        /// 抛出一个指定的和内部有关的异常消息
        /// </summary>
        /// <param name="message">指定异常消息</param>
        /// <param name="innerException"></param>
        public RCSoftException(string message, Exception innerException)
            : base(message, innerException)
        { 
        
        }
    }
}
